package com.cn.study0014.test002;

/**
 * @author lw
 * @ClassName StudentsBiz.java
 * @Description
 * @createTime 2023年05月18日 13:42:00
 */
public class StudentsBiz {
    String[] names = new String[30];
    int i = 0;
    public void addNames(String name) {
        names[i] = name;
        i++;
    }
    public void showNames() {
        for (int j = 0; j <names.length ; j++) {
            if (names[j]!=null){
                System.out.println(names[j]);
            }
        }
    }
    public boolean searchName(int start,int end,String name){
        boolean find = false;   //是否找到标识
        for (int i = start-1; i < end; i++) {
            if (names[i].equals(name)){
                find=true;
                break;
            }
        }
        return find;
    }
}
